﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reactive;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace SensorDrone.Net.Extensions
{
    /// <summary>
    /// Extensions to sensordrone.net
    /// </summary>
    public static class Extensions
    {
        /// <summary>
        /// Converts the drone readings to a Observable
        /// <example>
        /// var sensors = drone.Sensors();
        /// var observable = drone.AsOberservable(sensors);
        /// var subscriber = observable.Timestamp().Subscribe(OnReading);
        /// </example>
        /// </summary>
        /// <param name="drone">The drone</param>
        /// <param name="sensors">Sensors to sample</param>
        /// <returns>An IObservable</returns>
        public static IObservable<Reading> AsObservable(this ISensorDrone drone,IEnumerable<string> sensors)
        {
            return new SensorDroneStream(drone, sensors);
        }

        
   
    }
}
